package com.longge;

public class OddCells {

    public int oddCells(int m, int n, int[][] indices) {

        int[][] res = new int[m][n];

        for (int[] index : indices) {
            for (int i = 0; i < res.length; i++) {
                if (index[0]==i){
                    for (int j = 0; j < res[0].length; j++) {
                        res[i][j]+=1;
                    }
                }
            }
            for (int i = 0; i < res[0].length; i++) {
                if (index[1]==i){
                    for (int j = 0; j < res.length; j++) {
                        res[j][i]+=1;
                    }
                }
            }
        }
        int ans = 0;
        for (int[] re : res) {
            for (int i : re) {
                if (i%2==1) ans++;
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        new OddCells().oddCells(2,3,new int[][]{{0,1},{1,1}});
    }

}
